package com.lwj.springboot.controller;

import com.lwj.springboot.entity.User;
import com.lwj.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by LiWeijie on 2019/1/23.
 */
@Controller
@RequestMapping(value = "/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "index")
    @ResponseBody
    public List<User> index(User user){

        return userService.listAll(user);
    }
}
